package testMore;

import java.util.Scanner;

public class Test31 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        while (scanner.hasNext()){
            String s = scanner.nextLine();
            String[] ss = s.split("[^a-zA-Z]");
            StringBuilder sb = new StringBuilder();
            for (int i = ss.length-1; i >=0 ; i--) {
                sb.append(ss[i]).append(" ");
            }

            System.out.println(sb.toString());
        }
    }
}
